home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
misc
/
executiv.lha
/
Executive_V1.00
/
sysinfo.lzx
/
include
/
libraries
/
sysinfo.h
Wrap
C/C++ Source or Header
|
1991-03-28
|
7KB
|
244 lines
#ifndef LIBRARIES_SYSINFO_H
#define LIBRARIES_SYSINFO_H
/*
** $VER: sysinfo.h 1.0 (14.3.95)
** Sysinfo Release 1.0
**
** sysinfo.library definitions
**
** This file is public domain.
**
** Author: Petri Nordlund <petrin@mits.mdata.fi>
**
** $Id: sysinfo.h 1.1 1995/05/28 13:21:08 petrin Exp petrin $
**
*/
#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif /* EXEC_TYPES_H */
#ifndef EXEC_PORTS_H
#include "exec/ports.h"
#endif /* EXEC_PORTS_H */
#define SYSINFONAME "sysinfo.library"
#define SYSINFOVERSION 1L
/*
* This structure is returned by InitSysinfo() and it's READ-ONLY.
*
* NOTE!! This structure will grow in the future, so don't make any assumptions
* about it's length.
*
*/
struct sysinfo {
/* general */
int errno; /* Used to hold error values */
/* from some functions */
/* load average */
UWORD loadavg_type; /* load average type, see below */
UWORD loadavg_time1; /* Usually 1, 5 and 15 minutes. */
UWORD loadavg_time2; /* These times are in seconds. */
UWORD loadavg_time3; /* 0 = time not implemented */
UWORD fscale; /* scale value, if lavgtype = FIXED */
/* id */
BOOL GetPpid_implemented; /* TRUE if GetPpid is implemented */
BOOL GetPgrp_implemented; /* TRUE if GetPgrp is implemented */
/* get/setnice */
UWORD which_implemented; /* Search methods for Get/SetNice */
WORD nicemin; /* Nice-value giving most cpu time */
WORD nicemax; /* Nice-value giving least cpu time */
/* notify */
BOOL notify_sig_implemented; /* Notify by signal implemented */
BOOL notify_msg_implemented; /* Notify by message implemented */
/* cpu usage */
UWORD cpu_usage_implemented; /* What cpu usage values are implemented */
/* task cpu usage */
UWORD task_cpu_usage_implemented; /* What cpu usage values are implemented*/
};
/*
* general
*
*/
/* errno values */
#define WHICH_EPERM 1 /* Operation not permitted */
#define WHICH_ESRCH 3 /* No such process */
#define WHICH_EACCES 13 /* Permission denied */
#define WHICH_EINVAL 22 /* Invalid argument */
/*
* load average
*
*/
/* Loadaverage type */
#define LOADAVG_NONE 0 /* load averages not implemented */
#define LOADAVG_FIXEDPNT 1 /* load * fscale */
#define LOADAVG_FLOAT 2 /* floating point numbers */
/* GetLoadAverage */
struct loadaverage_fixed {
ULONG load1;
ULONG load2;
ULONG load3;
};
struct loadaverage_float {
float load1;
float load2;
float load3;
};
/* This is needed when calling GetLoadAverage() */
struct loadaverage {
union {
struct loadaverage_fixed lavg_fixed;
struct loadaverage_float lavg_float;
} loadaverage;
ULONG reserved1; /* Reserved for future use */
ULONG reserved2; /* Reserved for future use */
};
/*
* get/setnice
*
*/
/* Possible search methods for Get/SetNice */
#define WHICH_PRIO_PROCESS 0
#define WHICH_PRIO_PGRP 1
#define WHICH_PRIO_USER 2
#define WHICH_PRIO_TASK 3
/* These bits are used in which_implemented-field */
#define WHICHB_PRIO_PROCESS 0
#define WHICHB_PRIO_PGRP 1
#define WHICHB_PRIO_USER 2
#define WHICHB_PRIO_TASK 3
#define WHICHF_PRIO_PROCESS (1L<<0)
#define WHICHF_PRIO_PGRP (1L<<1)
#define WHICHF_PRIO_USER (1L<<2)
#define WHICHF_PRIO_TASK (1L<<3)
/*
* notify
*
*/
/* This is needed when adding a notify-request. This may grow in future */
struct sysinfo_notify {
struct MsgPort *notify_port; /* message port for notify-messages */
WORD signal; /* signal NUMBER if you use signals */
};
/*
* cpu usage
*
*/
/* This is needed when querying cpu usage */
struct cpu_usage {
ULONG total_used_cputime; /* Total used cputime in seconds */
ULONG total_elapsed_time; /* Total used+idle cputime in seconds */
ULONG used_cputime_lastsec; /* Used cputime during last second */
ULONG used_cputime_lastsec_hz; /* 100 * lastsec / lastsec_hz = CPU % */
ULONG recent_used_cputime; /* Recently used cputime */
ULONG recent_used_cputime_hz; /* 100 * recent / hz = RECENT CPU % */
UWORD recent_seconds; /* "recent" means this many seconds */
ULONG involuntary_csw; /* Involuntary context switches */
ULONG voluntary_csw; /* Voluntary context switches */
ULONG total_csw; /* Total # of context switches */
ULONG involuntary_csw_lastsec; /* Involuntary csws during last second */
ULONG voluntary_csw_lastsec; /* Voluntary csws during last second */
ULONG total_csw_lastsec; /* Total # of csws during last second */
ULONG reserved[12]; /* Reserved for future use */
};
/* These bits are used in cpu_usage_implemented-field */
#define CPU_USAGEB_TOTAL_IMPLEMENTED 0
#define CPU_USAGEB_LASTSEC_IMPLEMENTED 1
#define CPU_USAGEB_RECENT_IMPLEMENTED 2
#define CPU_USAGEB_IVVOCSW_IMPLEMENTED 3
#define CPU_USAGEB_TOTALCSW_IMPLEMENTED 4
#define CPU_USAGEB_IVVOCSW_LASTSEC_IMPLEMENTED 5
#define CPU_USAGEB_TOTALCSW_LASTSEC_IMPLEMENTED 6
#define CPU_USAGEF_TOTAL_IMPLEMENTED (1L<<0)
#define CPU_USAGEF_LASTSEC_IMPLEMENTED (1L<<1)
#define CPU_USAGEF_RECENT_IMPLEMENTED (1L<<2)
#define CPU_USAGEF_IVVOCSW_IMPLEMENTED (1L<<3)
#define CPU_USAGEF_TOTALCSW_IMPLEMENTED (1L<<4)
#define CPU_USAGEF_IVVOCSW_LASTSEC_IMPLEMENTED (1L<<5)
#define CPU_USAGEF_TOTALCSW_LASTSEC_IMPLEMENTED (1L<<6)
/*
* task cpu usage
*
*/
/* This is needed when querying cpu usage of a task */
struct task_cpu_usage {
ULONG total_used_cputime; /* Total used cputime */
ULONG total_used_time_hz; /* used_cputime / hz = cputime in secs */
ULONG total_elapsed_time; /* Total used+idle cputime in seconds */
ULONG used_cputime_lastsec; /* Used cputime during last second */
ULONG used_cputime_lastsec_hz; /* 100 * lastsec / lastsec_hz = CPU % */
ULONG recent_used_cputime; /* Recently used cputime */
ULONG recent_used_cputime_hz; /* 100 * recent / hz = RECENT CPU % */
UWORD recent_seconds; /* "recent" means this many seconds */
ULONG involuntary_csw; /* Involuntary context switches */
ULONG voluntary_csw; /* Voluntary context switches */
ULONG total_csw; /* Total # of context switches */
ULONG involuntary_csw_lastsec; /* Involuntary csws during last second */
ULONG voluntary_csw_lastsec; /* Voluntary csws during last second */
ULONG total_csw_lastsec; /* Total # of csws during last second */
ULONG reserved[8]; /* Reserved for future use */
};
/* These bits are used in cpu_usage_implemented-field */
#define TASK_CPU_USAGEB_TOTAL_IMPLEMENTED 0
#define TASK_CPU_USAGEB_LASTSEC_IMPLEMENTED 1
#define TASK_CPU_USAGEB_RECENT_IMPLEMENTED 2
#define TASK_CPU_USAGEB_IVVOCSW_IMPLEMENTED 3
#define TASK_CPU_USAGEB_TOTALCSW_IMPLEMENTED 4
#define TASK_CPU_USAGEB_IVVOCSW_LASTSEC_IMPLEMENTED 5
#define TASK_CPU_USAGEB_TOTALCSW_LASTSEC_IMPLEMENTED 6
#define TASK_CPU_USAGEF_TOTAL_IMPLEMENTED (1L<<0)
#define TASK_CPU_USAGEF_LASTSEC_IMPLEMENTED (1L<<1)
#define TASK_CPU_USAGEF_RECENT_IMPLEMENTED (1L<<2)
#define TASK_CPU_USAGEF_IVVOCSW_IMPLEMENTED (1L<<3)
#define TASK_CPU_USAGEF_TOTALCSW_IMPLEMENTED (1L<<4)
#define TASK_CPU_USAGEF_IVVOCSW_LASTSEC_IMPLEMENTED (1L<<5)
#define TASK_CPU_USAGEF_TOTALCSW_LASTSEC_IMPLEMENTED (1L<<6)
#endif /* LIBRARIES_SYSINFO_H */